import { ecs } from 'db://app-game/libs/ecs/ECS';

/** 地图基础组件 */
@ecs.register('LevelMapModel')
export class LevelMapModelComp extends ecs.Comp {
  table: TableMap = new TableMap();
  _id: number = -1;
  /** 地图编号 */
  get id(): number {
    return this._id;
  }
  set id(value: number) {
    this._id = value;
    this.table.init(value);
  }

  /** 分组地图宽 */
  get chunkMapWidth(): number {
    return 1000;
  }
  /** 分组地图高 */
  get chunkMapHeight(): number {
    return 1000;
  }
  /** 瓷砖宽 */
  get tileWidth(): number {
    return 20;
  }
  /** 瓷砖高 */
  get tileHeight(): number {
    return 20;
  }
  /** 瓷砖列数 */
  get tileColNumber(): number {
    return 50;
  }
  /** 瓷砖行数 */
  get tileRowNumber(): number {
    return 50;
  }

  /** 地图文件路径 */
  get mapFilePath(): string {
    return this.table.mapFilePath;
  }

  reset(entity: ecs.Entity): void {}
}
